<template>
  <div class="add-activity">
    <div class="add-activity-header">全部活动</div>
    <el-row :gutter="20" class="activity-grids">
      <el-col v-for="(item,index) in list" :key="index" :span="6">
        <div class="grid-item" @click="handleClick(item)">
          <div v-if="index!==3" class="phone-wrap">
            <el-tooltip :content="item.tooltip" placement="bottom-start" effect="light">
              <i class="el-icon-info" style="color:#fff"/>
            </el-tooltip>
          </div>
          {{ item.title }}
        </div>
      </el-col>
    </el-row>
    <!-- 弹框 -->
    <div>
      <!-- 帮砍价弹框 -->
      <el-dialog :visible.sync="dialog.cutPrice" title="服务到期提醒" width="50%">
        <div class="dialog-con">帮砍价服务已到期，无法新建，如需继续使用该服务，需要立即订购？</div>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="orderNow()">立即订购</el-button>
        </div>
      </el-dialog>
      <!-- 多人拼团弹框 -->
      <el-dialog :visible.sync="dialog.groupPurchase" title="服务到期提醒" width="50%">
        <div class="dialog-con">多人拼团服务已到期，无法新建，如需继续使用该服务，需要立即订购？</div>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="orderNow()">立即订购</el-button>
        </div>
      </el-dialog>
      <!-- 秒杀弹框 -->
      <el-dialog :visible.sync="dialog.quickSell" title="服务到期提醒" width="50%">
        <div class="dialog-con">秒杀服务已到期，无法新建，如需继续使用该服务，需要立即订购？</div>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="orderNow()">立即订购</el-button>
        </div>
      </el-dialog>
      <!-- 竞答弹框 -->
      <el-dialog :visible.sync="dialog.correct" title="服务到期提醒" width="50%">
        <div class="dialog-con">竞答服务已到期，无法新建，如需继续使用该服务，需要立即订购？</div>
        <div slot="footer" class="dialog-footer">
          <el-button type="primary" @click="orderNow()">立即订购</el-button>
        </div>
      </el-dialog>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      list: [
        {
          title: '帮砍价',
          kind: 'cutPrice',
          tooltip: '砍价活动可接入微版新网校'
        },
        {
          title: '多人拼团',
          kind: 'groupPurchase',
          tooltip: '拼团活动可接入微版新网校'
        },
        {
          title: '秒杀',
          kind: 'quickSell',
          tooltip: '秒杀活动可接入微版新网校'
        // },
        // {
        //   title: '竞答',
        //   kind: 'correct'
        }
      ],
      dialog: {
        cutPrice: false,
        groupPurchase: false,
        quickSell: false,
        correct: false
      },
      kindname: ''
    }
  },
  methods: {
    handleClick(item) {
      this.$router.push({ name: 'SeckillSet', params: item })
    }
  }
}
</script>

<style lang="scss">
.add-activity {
  &-header {
    font-size: 16px;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background-color: #f0f3ff;
    margin-bottom: 10px;
    margin-top: 30px;
  }
  .activity-grids {
    padding: 0 20px;
    .grid-item {
      position: relative;
      border: 1px solid #409eff;
      padding: 45px 0;
      text-align: center;
      border-radius: 8px;
      border-left-width: 5px;
      margin-bottom: 20px;
      .phone-wrap {
        position: absolute;
        left: 6px;
        top: 6px;
        width: 25px;
        height: 25px;
        border-radius: 50%;
        background-color: #ffa534;
        padding-top: 4px;
      }
      .phone-tip {
        color: #fff;
        font-size: 14px !important;
      }
    }
    .grid-item:hover {
      cursor: pointer;
      border: 1px solid #4073ff;
      border-left-width: 5px;
    }
  }
  .dialog-con {
    color: #48576a;
    font-size: 14px;
  }
}
</style>
